<?php
	session_start();
	include 'include/db.php';
	$username = $_POST['username'];
	$password = $_POST['password'];
	if (mysql_num_rows(mysql_query("SELECT id FROM users WHERE username='$username' AND password='$password'")) > 0)
	{
		$_SESSION['username'] = $username;
		header("Location: index.php");
	} else {
		header("Location: login.php");
	}

?>